'''
操作文件流程：
1.打开文件，创建文件对象 open()




'''

# test_file = r"E:\python\test\实例\text.txt"

# job = open(test_file,mode="r")      

# print(job.read())

# job.close()

# # ---------------遍历文件内容-----------------

# test_file = r"E:\python\test\实例\text.txt"

# job = open(test_file,mode="r") 

# for line in job:
#     print("按行输出"line)

#--------------------- with 关键字------------------

test_file = r"E:\python\test\实例\text.txt"

with open(test_file,mode="r") as job:
    for line in job:
        print("按行输出:",line)

